import 'package:cbec_app/entity/home/content/content_data.dart';

class SpecialPriceData extends ContentData{
  final String activityName;
  final String countdownTextColor;
  final int moreBtnStyle;
  final String displayScale;
  final String imageFillStyle;
  final String title;
  final String cornerMarkType;
  final String textAlignType;
  final String showCornerMark;
  final String uuid;
  final String activityNameColor;
  final String textStyleType;
  final String price;
  final String showStockNum;
  final String moreBtnColor;
  final List<dynamic> subEntry; // Adjust type if needed
  final int pageMargin;
  final String countdownBgColor;
  final String sizeType;
  final String showCountDown;
  final String moreBtnText;
  final String automatic;
  final String borderRadiusType;
  final int goodsMargin;
  final String showSoldNum;
  final String moreShow;
  final String bgColor;
  final String size;
  final String originPrice;
  final String cornerMarkImage;

  SpecialPriceData({
    required this.activityName,
    required this.countdownTextColor,
    required this.moreBtnStyle,
    required this.displayScale,
    required this.imageFillStyle,
    required this.title,
    required this.cornerMarkType,
    required this.textAlignType,
    required this.showCornerMark,
    required this.uuid,
    required this.activityNameColor,
    required this.textStyleType,
    required this.price,
    required this.showStockNum,
    required this.moreBtnColor,
    required this.subEntry,
    required this.pageMargin,
    required this.countdownBgColor,
    required this.sizeType,
    required this.showCountDown,
    required this.moreBtnText,
    required this.automatic,
    required this.borderRadiusType,
    required this.goodsMargin,
    required this.showSoldNum,
    required this.moreShow,
    required this.bgColor,
    required this.size,
    required this.originPrice,
    required this.cornerMarkImage,
  }) {
    type = 'ump_limitdiscount'; 
  }

  factory SpecialPriceData.fromJson(Map<String, dynamic> json) {
    return SpecialPriceData(
      activityName: json['activity_name'],
      countdownTextColor: json['countdown_text_color'],
      moreBtnStyle: json['more_btn_style'],
      displayScale: json['display_scale'],
      imageFillStyle: json['image_fill_style'],
      title: json['title'],
      cornerMarkType: json['corner_mark_type'],
      textAlignType: json['text_align_type'],
      showCornerMark: json['show_corner_mark'],
      uuid: json['uuid'],
      activityNameColor: json['activity_name_color'],
      textStyleType: json['text_style_type'],
      price: json['price'],
      showStockNum: json['show_stock_num'],
      moreBtnColor: json['more_btn_color'],
      subEntry: json['sub_entry'], // Adjust parsing if needed
      pageMargin: json['page_margin'],
      countdownBgColor: json['countdown_bg_color'],
      sizeType: json['size_type'],
      showCountDown: json['show_count_down'],
      moreBtnText: json['more_btn_text'],
      automatic: json['automatic'],
      borderRadiusType: json['border_radius_type'],
      goodsMargin: json['goods_margin'],
      showSoldNum: json['show_sold_num'],
      moreShow: json['more_show'],
      bgColor: json['bg_color'],
      size: json['size'],
      originPrice: json['origin_price'],
      cornerMarkImage: json['corner_mark_image'],
    );
  }

  @override
  ContentData fromJson(Map<String, dynamic> json) {
    return SpecialPriceData.fromJson(json);
  }

  @override
  Map<String, dynamic> toJson() {
    return {
      'activity_name': activityName,
      'countdown_text_color': countdownTextColor,
      'more_btn_style': moreBtnStyle,
      'display_scale': displayScale,
      'image_fill_style': imageFillStyle,
      'type': type,
      'title': title,
      'corner_mark_type': cornerMarkType,
      'text_align_type': textAlignType,
      'show_corner_mark': showCornerMark,
      'uuid': uuid,
      'activity_name_color': activityNameColor,
      'text_style_type': textStyleType,
      'price': price,
      'show_stock_num': showStockNum,
      'more_btn_color': moreBtnColor,
      'sub_entry': subEntry,
      'page_margin': pageMargin,
      'countdown_bg_color': countdownBgColor,
      'size_type': sizeType,
      'show_count_down': showCountDown,
      'more_btn_text': moreBtnText,
      'automatic': automatic,
      'border_radius_type': borderRadiusType,
      'goods_margin': goodsMargin,
      'show_sold_num': showSoldNum,
      'more_show': moreShow,
      'bg_color': bgColor,
      'size': size,
      'origin_price': originPrice,
      'corner_mark_image': cornerMarkImage,
    };
  }
  
  
}
